import React from 'react';
import { Popover } from 'antd';
import styles from './index.module.less';
import { platformTypeName } from '@/utils/config';

//项目中所有用到的tag

function getTag(val, qmType) {
	switch (val) {
		case 'shougongpop':
			return (
				<Popover content='手工订单或Excel导入订单'>
					<span className={`${styles['sign-box']} ${styles['background-green']}`}>手</span>
				</Popover>
			)
		case 'bufa':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>补发</span>
			)
		case 'importYuncang':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>已导入云仓运单</span>
			)
		case 'huanhuo':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>换货</span>
			)
		case 'syncOrder':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>同步订单</span>
			)
		case 'hebingpop':
			return (
				<Popover content='已合并订单'>
					<span className={`${styles['sign-box']} ${styles['background-red']}`}>合</span>
				</Popover>
			)
		case 'chaifenpop':
			return (
				<Popover content='已拆分订单'>
					<span className={`${styles['sign-box']} ${styles['background-blue']}`}>拆</span>
				</Popover>
			)
		case 'paoliangpop':
			return (
				<Popover content='跑量订单'>
					<span className={`${styles['sign-box']} ${styles['background-orange']}`}>跑</span>
				</Popover>
			)
		case 'yituikuan':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>已退款</span>
			)
		case 'daituikuan':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>待退款</span>
			)
		case 'yishangchuan':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>已上传</span>
			)
		case 'daishagnchuandanhao':
			return (
				<span className={`${styles['sign-box']} ${styles['background-orange']}`}>待上传单号</span>
			)
		case 'shangchuanshibai':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>上传失败</span>
			)
		case 'yitui':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>退</span>
			)
		case 'isVipPrice':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>会员价</span>
			)
		case 'isVipGoods':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>vip</span>
			)

		case 'daofupop':
			return (
				<Popover content='货到付款订单'>
					<span className={`${styles['sign-box']} ${styles['background-purple']}`}>COD</span>
				</Popover>
			)
		case 'dizhi':
			return (
				<span className={`${styles['sign-box']} ${styles['background-brown']}`}>地</span>
			)
		case 'shangpin':
			return (
				<Popover content={`${APP_TITLE}商城订单`}>
					<span className={`${styles['sign-box']} ${styles['background-orange']}`}>商</span>
				</Popover>
			)
		case 'dangkou':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>档口商品</span>
			)
		case 'zhihuannahuo':
			return (
				<Popover content='置换拿货'>
					<span className={`${styles['sign-box']} ${styles['background-blue']}`}>置换</span>
				</Popover>
			)
		case 'tuikuan':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>退</span>
			)
		case 'tuikuanError':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']} ${styles['font18']}`}>退款异常</span>
			)
		case 'stockLackError':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']} ${styles['font18']}`}>库存不足异常</span>
			)
		case 'tk':
			return (
				<span className={`${styles['sign-box']} ${styles['background-black']}`}>退款</span>
			)
		case 'yifahuo':
			return (
				<span className={`${styles['sign-box']} ${styles['background-purple']}`}>发</span>
			)
		case 'quehuo':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>缺</span>
			)
		case 'xj':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>下架</span>
			)
		case 'qh':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>缺货</span>
			)
		case 'yichang':
			return (
				<span className={`${styles['sign-box']} ${styles['background-blue']}`}>异常</span>
			)
		case 'yichangdanger':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>异常</span>
			)
		case 'zifa':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>库存商品</span>
			)
		case 'nahuo':
			return (
				<span className={`${styles['sign-box']} ${styles['background-purple']}`}>拿货商品</span>
			)
		case 'cjzf':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>供应商直发商品</span>
			)
		case 'yifenjian':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>已分拣</span>
			)
		case 'yigaijia':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>已改价</span>
			)
		case 'yinahuo':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>已拿货</span>
			)
		case 'dainahuo':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>待拿货</span>
			)
		case 'zuhe':
			return (
				<span className={`${styles['sign-box']} ${styles['background-deepblue']}`}>组合</span>
			)
		case 'JSTzuhe':
			return (
				<span className={`${styles['sign-box']} ${styles['background-black']}`}>聚水潭组合</span>
			)
		case 'lanshou':
			return (
				<span className={`${styles['sign-box']} ${styles['background-blue']}`}>揽</span>
			)
		case 'yilanjian':
			return (
				<span className={`${styles['sign-box']} ${styles['background-blue']}`}>已揽件</span>
			)
		case 'weidayin': //f59a23
			return (
				<span className={`${styles['sign-box']} ${styles['background-deepblue']}`}>未打印</span>
			)
		case 'yidayin': //f59a23
			return (
				<span className={`${styles['sign-box']} ${styles['background-deepblue']}`}>已打印</span>
			)
		case 'shouhou':
			return (
				<span className={`${styles['sign-box']} ${styles['background-orange']}`}>售后</span>
			)
		case 'tuikuanzhong':
			return (
				<span className={`${styles['sign-box']} ${styles['background-blue']}`}>退款中</span>
			)
		case 'bufentuikuan':
			return (
				<span className={`${styles['sign-box']} ${styles['background-orange']}`}>部分退款成功</span>
			)
		case 'bufennahuo':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>部分拿货</span>
			)
		case 'tuikuanchenggong':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>退款成功</span>
			)
		case 'nostockgoods':
			return (
				<span className={`${styles['sign-box']} ${styles['background-orange']}`}>无库存发货</span>
			)
		case 'AggregateLack':
			return (
				<span className={`${styles['sign-box']} ${styles['background-blue']}`}>总仓不足</span>
			)
		case 'AggregateEnough':
			return (
				<span className={`${styles['sign-box']} ${styles['background-blue']}`}>总仓充足</span>
			)
		case 'SeparateLack':
			return (
				<span className={`${styles['sign-box']} ${styles['background-blue']}`}>分仓不足</span>
			)
		case 'stockLack':
			return (
				<span className={`${styles['sign-box']} ${styles['background-blue']}`}>库存不足</span>
			)
		case 'storeNotOpen':
			return (
				<span className={`${styles['sign-box']} ${styles['background-blue']}`}>门店未开门</span>
			)
		case 'wmsSplitOrder':
			return (
				<span className={`${styles['sign-box']} ${styles['background-blue']}`}>拆分装箱</span>
			)
		case 'jingcang':
			return (
				<Popover content='京东仓'>
					<span className={`${styles['sign-box']} ${styles['background-purple']}`}>京仓订单</span>
				</Popover>
			)
		case 'yuncang':
			return (
				<Popover content='云仓订单'>
					<span className={`${styles['sign-box']} ${styles['background-purple']}`}>云仓订单</span>
				</Popover>
			)
		case 'noStorageDeliver':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>无库存发货</span>
			)
		case 'jingpei':
			return (
				<Popover content='消费者选择京配'>
					<span className={`${styles['sign-box']} ${styles['background-purple']}`}>消费者选择京配</span>
				</Popover>
			)
		case 'qimen':
			return (
				<span className={`${styles['sign-box']} ${styles['background-orange']}`}>{!qmType ? '奇门' : `奇门(${platformTypeName[qmType]})`}</span>
			)
		case 'zjfscht':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>{!qmType ? '商户后台' : `商户后台(${platformTypeName[qmType]})`}</span>
			)
		case 'quxiaodingdan':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>取消订单</span>
			)
		case 'match':
			return (
				<Popover content='匹配异常'>
					<span className={`${styles['sign-box']} ${styles['background-pink']}`}>匹配</span>
				</Popover>
			)
		case 'goodsError':
			return (
				<Popover content='商品异常'>
					<span className={`${styles['sign-box']} ${styles['background-red']}`}>商品</span>
				</Popover>
			)
		case 'pickGoodsIng':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>拿货中</span>
			)
		case 'yilanshou':
			return (
				<span className={`${styles['sign-box']} ${styles['background-lightred']}`}>已揽收</span>
			)
		case 'dailanshou':
			return (
				<span className={`${styles['sign-box']} ${styles['background-lightred']}`}>待揽收</span>
			)
		case 'tibaoyichang':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>提报异常</span>
			)
		case 'notAutoCheck':
			return (
				<span className={`${styles['sign-box']} ${styles['background-orange']}`}>不自动审核</span>
			)
		case 'alreadyFreightIntercept':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>运费拦截</span>
			)
		case 'cancelFreightIntercept':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>取消运费拦截</span>
			)
		case 'inExpressIntercept':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>快递拦截中</span>
			)
		case 'alreadyExpressIntercept':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>快递已拦截</span>
			)
		case 'cancelExpressIntercept':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>快递拦截取消</span>
			)
		case 'qiangzhifahuo':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>强制发货</span>
			)
		case 'custom':
			return (
				<span className={`${styles['sign-box']} ${styles['background-blue']}`}>自定义</span>
			)
		case 'imported':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>已导入</span>
			)
		case 'yidanduobao':
			return (
				<span className={`${styles['sign-box']} ${styles['background-lightred']}`}>一单多包</span>
			)
		case 'daishenhe':
			return (
				<span className={`${styles['sign-box']} ${styles['background-orange']}`}>待审核</span>
			)
		case 'shenheshibai':
			return (
				<span className={`${styles['sign-box']} ${styles['background-red']}`}>审核失败</span>
			)
		case 'shenhetongguo':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>审核通过</span>
			)
		case 'xianxiazhifu':
			return (
				<span className={`${styles['sign-box']} ${styles['background-orange']}`}>线下支付</span>
			)
		case 'jst':
			return (
				<span className={`${styles['sign-box']} ${styles['background-lightred']}`}>聚水潭</span>
			)
		case 'de_wu':
			return (
				<span className={`${styles['sign-box']} ${styles['background-lightred']}`}>得物</span>
			)
		case 'wechat_shop':
			return (
				<span className={`${styles['sign-box']} ${styles['background-lightred']}`}>视频号小店</span>
			)
		case 'jintuikuan':
			return (
				<span className={`${styles['sign-box']} ${styles['background-black']}`}>仅退款</span>
			)
		case 'tuihuotuikuan':
			return (
				<span className={`${styles['sign-box']} ${styles['background-black']}`}>退货退款</span>
			)
		case 'tmall':
			return (
				<span className={`${styles['sign-box']} ${styles['background-lightred']}`}>天猫供销</span>
			)
		case 'sn_fd':
			return (
				<span className={`${styles['sign-box']} ${styles['background-lightred']}`}>苏宁厂送</span>
			)
		case 'weiquerenshouhuo':
			return (
				<span className={`${styles['sign-box']} ${styles['background-brown']}`}>未确认收货</span>
			)
		case 'yiquerenshouhuo':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green2']}`}>已确认收货</span>
			)
		case 'jl_hyk':
			return (
				<span className={`${styles['sign-box']} ${styles['background-lightred']}`}>好衣库</span>
			)
		case '1688_c2m':
			return (
				<span className={`${styles['sign-box']} ${styles['background-lightred']}`}>淘工厂</span>
			)
		case 'kaifang':
			return (
				<span className={`${styles['sign-box']} ${styles['background-green']}`}>开放</span>
			)
		case 'goodEditError':
			return (
				<Popover content='商品修改异常'>
					<span className={`${styles['sign-box']} ${styles['background-purple']}`}>异常</span>
				</Popover>
			)
		case 'wdt':
			return (
				<span className={`${styles['sign-box']} ${styles['background-otherblue']}`}>旺店通</span>
			)
		case 'zf':
			return (
				<span className={`${styles['sign-box']} ${styles['background-otherblue']}`}>作废</span>
			)
        case "missingSubGoods":
            return <span className={`${styles["sign-box"]} ${styles["background-red"]}`}>组合装缺失</span>;
		case 'default':
			return (
				<span className={`${styles['sign-box']} ${styles['background-lightred']}`}>默认</span>
			)
		default:
			return null;
	}
}



export default ({ type, qmType }) => {
	const dom = getTag(type, qmType);
	return dom;
}
